package com.zareal.ymcc.controller;

import com.zareal.ymcc.doc.CourseSearchDoc;
import com.zareal.ymcc.result.JSONResult;
import com.zareal.ymcc.service.ICourseEsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/courseEs")
public class CourseEsController {
    @Autowired
    private ICourseEsService courseEsService;
    @PostMapping("/saveCourseEs")
    public JSONResult saveCourseEs(@RequestBody CourseSearchDoc courseSearchDoc){
        courseEsService.saveCourseEs(courseSearchDoc);
        return JSONResult.success();
    }
    @PostMapping("/deletCourseEs")
    public JSONResult deletCourseEs(@RequestBody Long courseId){
        courseEsService.deletCourseEs(courseId);
        return JSONResult.success();
    }
}
